<template>
  <div class="approval">
    <el-card class="box-card" style="margin-top: 110px;">
      <div class="title">{{$t('achievements.title1')}}</div>
      <div class="menu-search">
        <div class="menu-title">
          <!-- 渠道 -->
          <div class='searchItem'>
            <span>{{$t('productManage.channels')}}</span>
            <el-select v-model='listQuery.channel' size='small'>
                <el-option
                v-for='item in appChannel'
                :key='item.channel'
                :label='item.org_name'
                :value='item.channel'>
                </el-option>
            </el-select>
          </div>
          <!-- 产品名称 -->
          <div class="searchItem">
            <span>{{$t('approval.proName')}}</span>
            <el-input
              v-model="listQuery.productName"
              size="small"
              :placeholder="$t('productManage.formRule5')"
            ></el-input>
          </div>
          <!-- 状态 -->
          <div class='searchItem'>
            <span>{{$t('grouping.status')}}</span>
            <el-select v-model='listQuery.status' size='small'>
                <el-option
                v-for='item in statusArr'
                :key='item.value'
                :label='item.label'
                :value='item.value'>
                </el-option>
            </el-select>
          </div>
          <!-- 准贷等级 -->
          <div class='searchItem'>
            <span>{{$t('product.QuasiLoanLevel')}}</span>
            <el-select v-model='listQuery.levelId' size='small'>
                <el-option
                v-for='item in levelArr'
                :key='item.id'
                :label='item.level'
                :value='item.id'>
                </el-option>
            </el-select>
          </div>
          <div class="menu-title-btn" style="margin-left: 20px;">
            <button type="button" @click="search">{{$t('btn.query')}}</button>
            <button type='button' @click='reset'>{{$t('btn.reset')}}</button>
          </div>
        </div>
      </div>
    </el-card>
    <el-card class="box-card" style="margin-top: 10px;margin-bottom: 20px;">
      <div style="display: flex; justify-content: space-between;">
        <div class="title">{{$t('product.productList')}}</div>
        <div>
          <!-- 添加产品 -->
          <el-button
            type="primary"
            size="small"
            @click="addProductFn"
          >{{$t('product.addProduct')}}</el-button>
        </div>
      </div>
      <el-table
        v-loading="listLoading"
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%; margin-top: 5px;"
        border
        size="mini"
      >
        <el-table-column :label="$t('user.num')" header-align="center" align="center" width="60">
          <template slot-scope="scope">
            <span>{{scope.row.index}}</span>
          </template>
        </el-table-column>
        <!-- 产品名称 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="pName"
          :label="$t('approval.proName')"
          width="120"
        ></el-table-column>
        <!-- 借款金额 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="prodRange"
          :label="$t('reduDetail.loanAmt')"
          width="120"
        ></el-table-column>
        <!-- 借款期限 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="pTerm"
          :label="$t('product.LoanPeriod')"
          width="120"
        ></el-table-column>
        <!-- 利息利率 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="pInterest"
          :label="$t('productManage.interestRate1')"
          width="120"
        ></el-table-column>
        <!-- 管理费率 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="pAccountFee"
          :label="$t('productManage.manageRate1')"
          width="120"
        ></el-table-column>
        <!-- 征信服务费率 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="pCreditserviceFee"
          :label="$t('productManage.creditrating1')"
          width="120"
        ></el-table-column>
        <!-- 放款方式 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="lendWay"
          :label="$t('product.LendingMethod')"
          width="120"
        ></el-table-column>
        <!-- 订单号第三位标识 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="attr1"
          :label="$t('productManage.orderThird')"
          width="150"
        ></el-table-column>
        <!-- 用户转贷等级 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="levelValue"
          :label="$t('product.userQuasiLoanLevel')"
          width="120"
        ></el-table-column>
        <!-- 创建时间 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="ctrTime"
          :label="$t('approvalDetail.smsCrtTime')"
          width="170"
        ></el-table-column>
        <!-- 更新时间 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="updTime"
          :label="$t('keyword.updateTime')"
          width="170"
        ></el-table-column>
        <!-- 状态 -->
        <el-table-column
          header-align="center"
          align="center"
          prop="status"
          width="160"
          :label="$t('grouping.status')"
        >
          <template slot-scope="scope">
            <el-radio-group v-model="scope.row.status" size="small" @change.native="changeStatus(scope.row)">
                <el-radio :label="1" size="mini">{{$t("grouping.enable")}}</el-radio>
                <el-radio :label="2" size="mini">{{$t("AppVersion.blockup")}}</el-radio>
            </el-radio-group>
          </template>
        </el-table-column>
        <el-table-column align="center" :label="$t('user.operation')" width="100" fixed="right">
          <template slot-scope="scope">
            <el-button size="small" type="text" @click="handleDelete(scope.row)" style="color: #f56c6c;">{{$t('btn.delete')}}
                </el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination-container">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listQuery.page"
          :page-sizes="[10, 30, 50]"
          :page-size="listQuery.limit"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        ></el-pagination>
      </div>
    </el-card>
    <el-dialog
      :title="$t('product.addProduct')"
      :visible.sync="dialogSendFormVisible"
      :before-close="closeDialog"
    >
      <el-form :model="form" :rules="rules" ref="form" label-width="140px" style="height: 400px; overflow-y: scroll;">
        <!-- 产品名称 -->
        <el-form-item :label="$t('approval.proName')" prop="pName">
          <el-input size="small" v-model="form.pName" :placeholder="$t('productManage.formRule5')"></el-input>
        </el-form-item>
        <!-- 借款金额 -->
        <el-form-item :label="$t('reduDetail.loanAmt')" prop="prodRange">
          <el-input size="small" v-model="form.prodRange" :placeholder="$t('product.ruleProdRange')"  @keyup.native="prodRangeRule"></el-input>
        </el-form-item>
        <!-- 借款期限 -->
        <el-form-item :label="$t('product.LoanPeriod')" prop="pTerm">
          <el-input size="small" v-model="form.pTerm" :placeholder="$t('product.ruleProdTerm')" @keyup.native="pTermRule"></el-input>
        </el-form-item>
        <!-- 利息利率 -->
        <el-form-item :label="$t('productManage.interestRate1')" prop="pInterest">
          <el-input size="small" v-model="form.pInterest" :placeholder="$t('productManage.formRule2')"></el-input>
        </el-form-item>
        <!-- 管理费率 -->
        <el-form-item :label="$t('productManage.manageRate1')" prop="pAccountFee">
          <el-input size="small" v-model="form.pAccountFee" :placeholder="$t('productManage.formRule3')"></el-input>
        </el-form-item>
        <!-- 征信服务费率 -->
        <el-form-item :label="$t('productManage.creditrating1')" prop="pCreditserviceFee">
          <el-input size="small" v-model="form.pCreditserviceFee" :placeholder="$t('productManage.formRule4')"></el-input>
        </el-form-item>
        <!-- 逾期配置 -->
        <el-form-item :label="$t('productManage.overdueDeploy')" style="margin-bottom: 0px;">
          <div v-for="(domain, index) in form.productOverdueConfigRequests" :key="index" class="overdue-config">
            <el-form-item :prop="'productOverdueConfigRequests.' + index + '.startDay'" :rules="rules.startDay" label-width="0">
              <el-input type="number" v-model="domain.startDay" size='small' style="width: 75px" disabled=""></el-input>
            </el-form-item>
            <b style="font-weight: normal; margin: 0 5px; font-size: 12px; color: #5f5f61;">{{$t('lenders.go')}}</b>
            <el-form-item :prop="'productOverdueConfigRequests.' + index + '.endDay'" :rules="rules.endDay" label-width="0">
              <el-input type="number" v-model="domain.endDay" size='small' style="width: 75px" @input="endDayInput(domain, index)"></el-input>
            </el-form-item>
            <el-form-item :prop="'productOverdueConfigRequests.' + index + '.overdueRate'" :rules="rules.overdueRate" label-width="0">
              <el-input v-model="domain.overdueRate" size='small' style="width: 85px; margin-left: 30px;" :placeholder="$t('productManage.penaltyRate')" ></el-input>
            </el-form-item>
            <b style="font-weight: normal; margin: 0 8px 0 2px; font-size: 12px; color: #5f5f61;"></b>
            <el-form-item :prop="'productOverdueConfigRequests.' + index + '.overdueInterest'" :rules="rules.overdueInterest" label-width="0">
              <el-input v-model="domain.overdueInterest" size='small' style="width: 85px;" :placeholder="$t('productManage.allInRate')"></el-input>
            </el-form-item>
            <b style="font-weight: normal; margin: 0 8px 0 2px; font-size: 12px; color: #5f5f61;"></b>
            <el-button v-show="index !== 0 && index === form.productOverdueConfigRequests.length-1" size='small' class="el-icon-delete" @click.prevent="removeDomain(domain)"></el-button>
          </div>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" size='small' class="el-icon-plus" @click="addDeploy"></el-button>
        </el-form-item>
        <!-- 最大逾期天数 -->
        <el-form-item :label="$t('productManage.maxOverdue1')" prop="maxOverdueDay">
          <el-input type="number" size="small" v-model="form.maxOverdueDay" :placeholder="$t('product.ruleMaxOverdueDay')"></el-input>
        </el-form-item>
        <!-- 放款方式 -->
        <el-form-item :label="$t('product.LendingMethod')" prop="lendWay">
          <el-select v-model="form.lendWay" size="small">
            <el-option
              v-for="item in lendWayArr"
              :key="item.code"
              :label="item.inaMsg"
              :value="item.code"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- 准贷等级 -->
        <el-form-item :label="$t('product.QuasiLoanLevel')" prop="levelId">
          <el-select v-model='form.levelId' size='small'>
              <el-option
              v-for='item in levelArr'
              :key='item.id'
              :label='item.level'
              :value='item.id'>
              </el-option>
          </el-select>
        </el-form-item>
        <!-- 订单号第三位标识 -->
        <el-form-item :label="$t('productManage.orderThird')" prop="attr1">
          <el-input size="small" v-model="form.attr1" :placeholder="$t('product.ruleOrderThird')"></el-input>
        </el-form-item>
        <!-- 状态 -->
        <el-form-item :label="$t('grouping.status')" prop="status">
          <el-radio-group v-model="form.status">
            <el-radio :label="1" size="small">{{$t('grouping.enable')}}</el-radio>
            <el-radio :label="2" size="small">{{$t('AppVersion.blockup')}}</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
         <el-button
          type="primary"
          @click="saveFn('form')"
          :loading="isBatch"
        >{{$t('btn.conserve')}}</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { getChannels } from 'api/customQuery/index';
import { checkSpecificKey } from 'utils/validate.js';
import {
  page,
  getDropDownBox,
  updateStatus,
  saveOrUpdate,
  deleteByProductId,
  getMsgInfoByType
} from "api/product/productManager/index";
export default {
  data() {
    var validateInput = (rule, value, callback) => {
      if (!checkSpecificKey(value)) {
        callback(new Error("Special symbols are not supported"));
      } else {
        callback();
      }
    };
    return {
      lendWayArr: [],
      levelArr: [
        {
          id: '1',
          level: this.$t("rule.all")
        }
      ],
      appChannel: [],
      statusArr: [
        {
          value: '',
          label: this.$t("rule.all")
        },
        {
          value: 1,
          label: this.$t("grouping.enable")
        },
        {
          value: 2,
          label: this.$t("AppVersion.blockup")
        }
      ],
      form: {
        pName: undefined,
        prodRange: undefined,
        pTerm: undefined,
        pInterest: undefined,
        pAccountFee: undefined,
        pCreditserviceFee: undefined,
        productOverdueConfigRequests: [
          {
            startDay: 1,
            endDay: '',
            overdueRate: '',
            overdueInterest: ''
          }
        ],
        maxOverdueDay: undefined,
        lendWay: undefined,
        levelId: undefined,
        attr1: undefined,
        status: 1
      },
      rules: {
        pName: [
          {
            required: true,
            message: this.$t('productManage.formRule5')
          },
          { validator: validateInput, trigger: ["blur", "change"] }
        ],
        prodRange: [
          {
            required: true,
            message: this.$t('product.ruleProdRange')
          }
        ],
        pTerm: [
          {
            required: true,
            message: this.$t('product.ruleProdTerm')
          }
        ],
        pInterest: [
          {
            required: true,
            message: this.$t('productManage.formRule2')
          },
          { pattern: /^\d{1,9}(\.{0}|\.{1}\d{1,9})?$/, message: this.$t('product.ruleRate') }
        ],
        pAccountFee: [
          {
            required: true,
            message: this.$t('productManage.formRule3')
          },
          { pattern: /^\d{1,9}(\.{0}|\.{1}\d{1,9})?$/, message: this.$t('product.ruleRate') }
        ],
        pCreditserviceFee: [
          {
            required: true,
            message: this.$t('productManage.formRule4')
          },
          { pattern: /^\d{1,9}(\.{0}|\.{1}\d{1,9})?$/, message: this.$t('product.ruleRate') }
        ],
        startDay: [
          {
            required: true,
            message: this.$t('RiskManager.minVal')
          },
          { pattern: /^[0-9]*[1-9][0-9]*$/, message: this.$t('product.dayRule') }
        ],
        endDay: [
          {
            required: true,
            message: this.$t('RiskManager.maxVal')
          },
          { pattern: /^[0-9]*[1-9][0-9]*$/, message: this.$t('product.dayRule') }
        ],
        overdueRate: [
          {
            required: true,
            message: this.$t('productManage.penaltyRate')
          },
          { pattern: /^\d{1,9}(\.{0}|\.{1}\d{1,9})?$/, message: this.$t('product.ruleRate') }
        ],
        overdueInterest: [
          {
            required: true,
            message: this.$t('productManage.allInRate')
          },
          { pattern: /^\d{1,9}(\.{0}|\.{1}\d{1,9})?$/, message: this.$t('product.ruleRate') }
        ],
        maxOverdueDay: [
          {
            required: true,
            message: this.$t('product.ruleMaxOverdueDay')
          },
          { pattern: /^[0-9]*[1-9][0-9]*$/, message: this.$t('product.dayRule') }
        ],
        lendWay: [
          {
            required: true,
            message: this.$t('product.ruleLoanMethods')
          }
        ],
        attr1: [
          {
            required: true,
            message: this.$t('product.ruleOrderThird')
          },
          { pattern: /^[A-Za-z]{1}$/, message: this.$t('product.thirdFlagRule') }
        ],
        status: [
          {
            required: true,
            message: this.$t('NoticeManager.ruleStatus')
          }
        ]
      },
      dialogSendFormVisible: false,
      listLoading: false,
      total: null,
      listQuery: {
        limit: 10,
        page: 1,
        channel: '',
        productName: '',
        status: '',
        levelId: '1'
      },
      tableData: [],
      currentId: "",
      isBatch: false,
    };
  },
  computed: {
    ...mapGetters(["elements", "language", "productManagerPage"])
  },
  created() {
    if (this.productManagerPage.has(this.$route.path)) {
      this.listQuery = this.productManagerPage.get(this.$route.path);
    }
    // 渠道下拉
    getChannels().then(res => {
      this.appChannel = res.data;
      // 查询等级
      getDropDownBox({
        type: '1'
      }).then(res => {
        this.levelArr = [
          {
            id: '1',
            level: this.$t("rule.all")
          }
        ];
        if (res.data && res.data.length) {
          this.levelArr = this.levelArr.concat(res.data);
          this.listQuery.channel = this.appChannel[0].channel;
          this.getList();
        }
      })
    });
  },
  methods: {
    // 选择渠道
    // handleChannelChanged(value) {
    //   getDropDownBox({
    //     channel: value,
    //     type: '1'
    //   }).then(res => {
    //     this.levelArr = [
    //       {
    //         id: '1',
    //         level: this.$t("rule.all")
    //       }
    //     ];
    //     if (res.data && res.data.length) {
    //       this.levelArr = this.levelArr.concat(res.data);
    //       this.listQuery.levelId = '1';
    //     }
    //   })
    // },
    resetForm() {
      this.form = {
        pName: undefined,
        prodRange: undefined,
        pTerm: undefined,
        pInterest: undefined,
        pAccountFee: undefined,
        pCreditserviceFee: undefined,
        productOverdueConfigRequests: [
          {
            startDay: 1,
            endDay: '',
            overdueRate: '',
            overdueInterest: ''
          }
        ],
        maxOverdueDay: undefined,
        lendWay: undefined,
        levelId: undefined,
        attr1: undefined,
        status: 1
      }
    },
    // 借款金额
    prodRangeRule() {
      let val = this.form.prodRange;
      val = String(val).replace(/[^\.\d]/g,'');
      val = String(val).replace('.','');
      this.form.prodRange = Number(val)
    },
    // 借款期限
    pTermRule() {
      let val = this.form.pTerm;
      val = String(val).replace(/[^\.\d]/g,'');
      val = String(val).replace('.','');
      this.form.pTerm = Number(val)
    },
    // 放款方式下拉
    loanMethod() {
      let obj = {};
      obj.dictType = 'LEND_WAY';
      getMsgInfoByType(obj)
      .then(res => {
        this.lendWayArr = res.data;
      })
    },
    // 天数自加1
    endDayInput(item, index) {
      if (this.form.productOverdueConfigRequests[index + 1] !== undefined) {
        this.$set(this.form.productOverdueConfigRequests[index + 1], 'startDay', parseInt(item.endDay) + 1);
      }
    },
    // 删除逾期配置
    removeDomain(item) {
      this.$confirm(this.$t('user.cue1'), this.$t('user.cue2'), {
        confirmButtonText: this.$t('btn.confirm'),
        cancelButtonText: this.$t('btn.cancel'),
        type: 'warning'
      })
      .then(() => {
        let index = this.form.productOverdueConfigRequests.indexOf(item)
        if (index !== -1) {
          this.form.productOverdueConfigRequests.splice(index, 1)
        }
      })
      .catch(() => {
        this.$message({
          showClose: true,
          type: "info",
          message: this.$t('orderQuery.cue2')
        });
      });
    },
    closeDialog(done) {
      done();
      this.$refs["form"].resetFields();
      this.getList();
    },
    // 添加逾期配置
    addDeploy() {
      this.form.productOverdueConfigRequests.push({
        startDay: '',
        endDay: '',
        overdueRate: '',
        overdueInterest: ''
      });
      if (this.form.productOverdueConfigRequests[this.form.productOverdueConfigRequests.length - 2].endDay !== '') {
        this.$set(this.form.productOverdueConfigRequests[this.form.productOverdueConfigRequests.length - 1], 'startDay', parseInt(this.form.productOverdueConfigRequests[this.form.productOverdueConfigRequests.length - 2].endDay) + 1);
      }
    },
    // 添加产品
    addProductFn() {
      this.isBatch = false;
      this.resetForm();
      getDropDownBox({
        type: '2'
      }).then(res => {
        if (res.data && res.data.length) {
          this.levelArr = res.data;
        } else {
          this.levelArr = [];
        }
      })
      this.loanMethod();
      this.dialogSendFormVisible = true;
    },
    // 添加保存
    saveFn(formName) {
      const set = this.$refs;
      set[formName].validate(valid => {
        if (valid) {
          this.$confirm(this.$t('approvalDetail.cue1'), {
            confirmButtonText: this.$t('btn.confirm'),
            cancelButtonText: this.$t('btn.cancel'),
            type: "warning",
            center: true
          })
          .then(() => {
            this.isBatch = true;
            this.form.channel = this.listQuery.channel;
            saveOrUpdate(this.form)
              .then(res => {
                if (res.status === 200) {
                  this.isBatch = false;
                  this.dialogSendFormVisible = false;
                  this.getList();
                  this.$notify({
                    title: this.$t('user.success'),
                    message: this.$t('user.crtsuccess'),
                    type: 'success',
                    duration: 2000
                  });
                } else {
                  this.isBatch = false;
                }
              });
          })
          .catch(() => {
            this.isBatch = false;
            this.$message({
              showClose: true,
              type: 'info',
              message: this.$t('approvalDetail.cue3')
            });
          });
        } else {
          return false;
        }
      });
    },
    // 点击删除按钮
    handleDelete(row) {
      this.$confirm(this.$t('user.cue1'), this.$t('user.cue2'), {
        confirmButtonText: this.$t('btn.confirm'),
        cancelButtonText: this.$t('btn.cancel'),
        type: 'warning'
      })
        .then(() => {
          let obj = {};
          obj.productId = row.prodId;
          obj.channel = row.channel;
          deleteByProductId(obj).then(() => {
            this.$notify({
              title: this.$t("user.success"),
              message: this.$t("user.delsuccess"),
              type: "success",
              duration: 2000
            });
            const index = this.tableData.indexOf(row);
            this.tableData.splice(index, 1);
            this.getList();
          });
        })
        .catch(() => {
          this.$message({
            showClose: true,
            type: "info",
            message: this.$t('orderQuery.cue2')
          });
        });
    },
    changeStatus(row) {
      let obj = {};
      obj.channel = this.listQuery.channel;
      obj.productId = row.prodId;
      obj.status = row.status;
      updateStatus(obj).then(res => {
        if (res.status === 200) {
          this.$message({
            showClose: true,
            type: "success",
            message: this.$t("approvalDispatch.opersuccess")
          });
          this.getList();
        } else {
          this.$message({
            showClose: true,
            type: "warning",
            message: res.message
          });
          this.getList();
        }
      });
    },
    getList() {
      this.listLoading = true;
      this.$store.dispatch("saveProductManagerPage", {
        path: this.$route.path,
        listQuery: this.listQuery
      });
      let obj = {};
      obj.language = this.language;
      obj.page = this.listQuery.page;
      obj.limit = this.listQuery.limit;
      obj.channel = this.listQuery.channel;
      obj.productName = this.listQuery.productName;
      if (this.listQuery.status !== '') obj.status = this.listQuery.status;
      if (this.listQuery.levelId !== '1') obj.levelId = this.listQuery.levelId;
      page(obj).then(res => {
        this.listLoading = false;
        if (res.status === 200) {
          if (Number(res.data.total) > 0) {
            res.data.productDeatils.forEach((item, index) => {
              item.index =
                index + (this.listQuery.page - 1) * this.listQuery.limit + 1;
              let re = /(?=(?!\b)(\d{3})+$)/g;
              let str = String(item.prodRange)
              item.prodRange = str.replace(re, ',');
            });
            this.tableData = res.data.productDeatils;
          } else {
            res.data.records.forEach((item, index) => {
              item.index =
                index + (this.listQuery.page - 1) * this.listQuery.limit + 1;
            });
            this.tableData = res.data.records;
          }
          this.total = Number(res.data.total);
        } else {
          this.$message({
            showClose: true,
            type: "warning",
            message: res.message
          });
        }
      });
    },
    //查询
    search() {
      this.listQuery.page = 1;
      this.getList();
    },
    //重置
    reset() {
      this.listQuery.channel = this.appChannel[0].channel;
      this.listQuery.productName = '';
      this.listQuery.status = '';
      this.listQuery.levelId = '1';
    },
    handleSizeChange(val) {
      this.listQuery.limit = val;
      this.getList();
    },
    handleCurrentChange(val) {
      this.listQuery.page = val;
      this.getList();
    }
  }
};
</script>

<style scoped lang='scss'>
.box-card {
  width: 95%;
  margin-left: 2.5%;
  margin-right: 2.5%;
}
.title {
  line-height: 30px;
  font-size: 16px;
  display: flex;
  align-items: center;
  font-weight: bold;
}
.title:before {
  display: block;
  content: "";
  width: 3px;
  height: 16px;
  background-color: #309afe;
}
.title:before {
  margin-right: 8px;
}
::before {
  box-sizing: inherit;
  -webkit-tap-highlight-color: transparent;
}
.menu-title {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  .searchItem {
    display: flex;
    align-items: center;
    padding: 10px 0;
    span {
      display: inline-block;
      width: 100px;
      text-align: right;
      font-size: 12px;
      color: #5f5f61;
      padding-right: 5px;
    }
    div:nth-child(2) {
      width: 150px;
    }
  }
  .searchItem-date {
    display: flex;
    align-items: center;
    padding: 10px 0;
    b {
      margin: 0 10px;
      font-weight: normal;
      font-size: 12px;
      color: #5f5f61;
    }
    div {
      width: 150px;
    }
  }
}
.menu-title-btn {
  padding: 10px 0;
  box-sizing: border-box;
  button {
    padding: 0 20px;
    height: 28px;
    background: #20a0ff;
    color: #fff;
    outline: none;
    border-width: 0;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    &:nth-child(1) {
      margin-left: 0;
    }
    &:nth-child(2) {
      background: #ebf5ff;
      color: #20a0ff;
      border: 1px solid #abd5ff;
    }
  }
  button[disabled] {
    padding: 0 20px;
    height: 28px;
    background: #c1e0ff;
    color: #fafbff;
    outline: none;
    border-width: 0;
    border-radius: 4px;
    font-size: 12px;
  }
}
.menu-list {
  padding: 20px 0;
  box-sizing: border-box;
  button {
    padding: 0 20px;
    height: 28px;
    background: #20a0ff;
    color: #fff;
    outline: none;
    border-width: 0;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    &:nth-child(1) {
      margin-left: 0;
    }
  }
  button[disabled] {
    padding: 0 20px;
    height: 28px;
    background: #c1e0ff;
    color: #fafbff;
    outline: none;
    border-width: 0;
    border-radius: 4px;
    font-size: 12px;
  }
}
.overdue-config {
  display: flex;
  padding: 3px 0; 
  box-sizing: border-box;
}
</style>